<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>增加菜单</title>
		<%@ include file="/commons/css_js_head.jsp"%>
		<script type="text/javascript">
//复写Url
doSaveUrl = "${ctx }/permission/efMenuAction!doSave.ts";
doReturnUrl = "${ctx }/permission/efMenuAction!doList.ts";

//保存
function doSave() {
	var _form = document.forms[0];
	if (doSaveUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doSaveUrl;
}

//校验数据
$(document).ready(function(){
	
	$.formValidator.initConfig({formid:"form1",alertmessage:true,onerror:function(msg){alert(msg)},onsuccess:function(){doSave();}});
	
	$("#_efMenu_menuName").formValidator().inputValidator({min:1,max:32,onerror:"请输入菜单名称，且只能在1-32个汉字之间"});
	$("#_efMenu_menuUrl").formValidator().inputValidator({min:1,max:256,onerror:"请输入菜单URL，且只能在1-256个字符之间"});
	$("#_efMenu_menuPhotoUrl").formValidator().inputValidator({max:256,onerror:"菜单图片URL最多只能256个字符"});
	$("#_efMenu_displayNo").formValidator().inputValidator({min:1,max:3,onerror:"请输入菜单显示顺序，且只能在1-999之间"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"格式不正确"});

});

</script>
	</head>

	<body style="overflow-y: auto; overflow-x: hidden">
		<div class="mTitle">
			<b class="bbig">增加菜单</b> 带
			<b class="fred"> * </b>号为必填项
		</div>

		<s:form action="/permission/efMenuAction" method="post" id="form1" theme="simple">

			<!--list -->
			<div class="mainAdd">
				<table class="addTable">
					<tr>
						<th width="10%">
							<b class="fred">*</b>上级菜单：
						</th>
						<td width="40%">
							<s:hidden name="efMenu.parentMenuId" theme="simple" ></s:hidden>
							<s:textfield name="parentMenuName" theme="simple" readonly="true" cssStyle="background:#ECEEEC" size="50"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="10%">
							<b class="fred">*</b>菜单名称：
						</th>
						<td width="40%">
							<s:textfield id="_efMenu_menuName" name="efMenu.menuName" theme="simple" maxlength="32"
								size="50"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="10%">
							<b class="fred">*</b>菜单URL：
						</th>
						<td width="40%">
							<s:textfield id="_efMenu_menuUrl" name="efMenu.menuUrl" theme="simple" maxlength="256"
								size="50"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="10%">
							菜单图片：
						</th>
						<td width="40%">
							<s:textfield id="_efMenu_menuPhotoUrl" name="efMenu.menuPhotoUrl" theme="simple"
								maxlength="256" size="50"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="10%">
							<b class="fred">*</b>菜单显示顺序：
						</th>
						<td width="40%">
							<s:textfield id="_efMenu_displayNo" name="efMenu.displayNo" theme="simple" maxlength="3"
								size="50"></s:textfield>
						</td>
					</tr>
					<tr>
						<th width="10%">
							菜单类型：
						</th>
						<td width="40%">
							<s:textfield id="_efMenu_linkType" name="efMenu.linkType" theme="simple" maxlength="64"
								size="50"></s:textfield>
							<span class="icon_help">&nbsp;</span>如果是弹出式窗口就输入thickbox，其它则为空。
						</td>
					</tr>
					<tr>
						<th width="10%">
							目标：
						</th>
						<td width="40%">
							<s:textfield id="_efMenu_target" name="efMenu.target" theme="simple" maxlength="64"
								size="50"></s:textfield>
							<span class="icon_help">&nbsp;</span>输入显示页面的窗口名称
						</td>
					</tr>					
					<tr>
						<th width="10%">
							<b class="fred">*</b>菜单状态：
						</th>
						<td width="40%">
							<select name="efMenu.dicMenuIsValid">
								<ef:option groupname="DicRoleIsValid"
									selectedValue="${efMenu.dicMenuIsValid}" link="true"></ef:option>
							</select>
						</td>
					</tr>


				</table>
			</div>
			<!--end table -->

			<div class="addToolbar">
				<p>
					<input class="btn" name="btn_confirm" type="submit" value="确定"/>
				</p>
			</div>
		</s:form>

<script>
//刷新左边的菜单树
refreshFrame("left");
</script>

	</body>
</html>
